<html>
	<head>
		<script src="js/webrtcstreamer.js"></script>
		<script>
			//     // 接受从vue组件中传过来的参数
			var url = location.search; //这一条语句获取了包括问号开始到参数的最后，不包括前面的路径
			var params = url.substr(1); //去掉问号
			var pa = params.split("&");
			var s = new Object();
			for (var i = 0; i < pa.length; i++) {
				s[pa[i].split("=")[0]] = unescape(pa[i].split("=")[1]);
			}
			window.onload = function() {
				webRtcServer = new WebRtcStreamer("video", `http://${s.serve}`);
				webRtcServer.connect(s.data);
				console.log("视频链接",s.data,s.serve)
			}
			window.onbeforeunload = function() {
				webRtcServer.disconnect();
			}
		</script>
	</head>
	<body style="margin: 0">
		<video id="video" controls autoplay muted style="width: 100%;height: 100%;object-fit: fill;" />
	</body>
</html>
